package lxt.service;

import java.util.ArrayList;
import java.util.List;

import lxt.entity.BorrowTruckInfo;
import lxt.entity.ChargeRecord;
import lxt.entity.InvoiceInfo;
import lxt.entity.InvoiceOrder;

/**
 * 订单service
 * 
 * @author lit
 * 
 */
public interface InvoiceOrderService {
	/**
	 * 查询所有订单号
	 */
	public List<InvoiceOrder> loadAll() throws Exception;

	/**
	 * 分页查询所有订单
	 * @param orderTime 订单日期
	 * @param ClientNameS 发货单位
	 * @param ClientNameR 收货单位
	 * @param offset
	 * @param pageSize
	 * @return
	 */
	public List<InvoiceOrder> loadByPage(String orderTime, String ClientNameS,
			String ClientNameR, int offset, Integer pageSize)
			throws Exception;

	/**
	 * 根据分页条件查询订单条数
	 * @param orderTime 订单日期
	 * @param ClientNameS 发货单位
	 * @param ClientNameR 收货单位
	 * @return
	 */
	public Integer loadOrderCount(String orderTime, String ClientNameS,
			String ClientNameR) throws Exception;
	
	/**
	 * 添加订单
	 * @param charge
	 * @return
	 * @throws Exception
	 */
	public boolean addInvoiceOrder(InvoiceOrder invoiceOrder,ArrayList<InvoiceInfo> InvoiceInfos,
			ChargeRecord chargeRecordS,ChargeRecord chargeRecordR,ArrayList<String> drivers,ArrayList<BorrowTruckInfo> borrowTrucks
			)throws Exception;
	/**
	 * 根据id加载订单信息
	 * @param invoiceOrderId
	 * @return
	 * @throws Exception
	 */
	public InvoiceOrder loadInvoiceOrderById(String invoiceOrderId)throws Exception;
	/**
	 * 修改订单信息
	 * @param invoiceOrder
	 * @return
	 * @throws Exception
	 */
	public boolean updateInvoiceOrder(InvoiceOrder invoiceOrder,String falg,ArrayList<InvoiceInfo> invoiceInfos,ChargeRecord chargeRecordS,ChargeRecord chargeRecordR,ArrayList<String> drivers,ArrayList<BorrowTruckInfo> borrowTrucks)throws Exception;
	/**
	 * 删除订单信息
	 * @param invoiceOrderId
	 * @return
	 * @throws Exception
	 */
	public boolean deleteInvoiceOrder(String invoiceOrderId)throws Exception;
	/**
	 * 根据格式化的日期查询订单ID
	 * @param date
	 * @return
	 * @throws Exception
	 */
	public List<String> queryOrderId(String date) throws Exception;
	/**
	 * 查询需要派单数据的条数
	 */
	public int loadInvosOrderIdCount(String order)throws Exception;
}
